<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>@yield('title')</title>

    <!-- Styles -->
    <link rel="stylesheet" href="{{ asset('css/app.css') }}">
    <!-- Custom style -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
    <link rel="stylesheet" href="{{asset('css/watermelon.css')}}">
</head>
<body>
<div id="app">
    <nav style="display: none" class="navbar navbar-default navbar-static-top">
        <div class="container">
            <div class="navbar-header">

                <!-- Collapsed Hamburger -->
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse">
                    <span class="sr-only">Toggle Navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>

                <!-- Branding Image -->
                <a class="navbar-brand" href="{{ url('/') }}">
                    {{ config('app.name', 'watermelon') }}
                </a>
            </div>

            <div class="collapse navbar-collapse" id="app-navbar-collapse">
                <!-- Left Side Of Navbar -->
                <ul class="nav navbar-nav">
                    &nbsp;
                </ul>

                <!-- Right Side Of Navbar -->
                <ul class="nav navbar-nav navbar-right">
                    <!-- Authentication Links -->
                    @guest
                        <li><a href="{{ route('login') }}">登录</a></li>
                        <li><a href="{{ route('register') }}">注册</a></li>
                    @else
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                                {{ Auth::user()->name }} <span class="caret"></span>
                            </a>

                            <ul class="dropdown-menu" role="menu">
                                <li>
                                    <a href="{{ route('logout') }}"
                                       onclick="event.preventDefault();
                                                 document.getElementById('logout-form').submit();">
                                        退出
                                    </a>

                                    <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                        {{ csrf_field() }}
                                    </form>
                                </li>
                            </ul>
                        </li>
                    @endguest
                </ul>
            </div>
        </div>
    </nav>
    <div class="wrapper">
        <div class="water_admin_header water_clear_fix">
            <div class="water_admin_logo water_clear_fix">
                <div class="water_admin_icon">
                    <img src="{{asset('/images/avatar.jpg')}}" alt="头像">
                </div>
                <div class="water_admin_intro">
                    西瓜大侠
                </div>
            </div>
            <div class="water_admin_nav_bar">
                <i class="zmdi zmdi-menu zmdi-hc-2x"></i>
            </div>
        </div>
        <div class="water_admin_main_side">
            <a href="/home" class="sidebar_select">
                文章列表
            </a>
            <a href="/add">
                撰写文章
            </a>
        </div>
        <div class="water_main_wrap">
            @yield('content')
        </div>
    </div>

</div>

<!-- Scripts -->
<script src="{{asset('lib/jquery.3.2.1.min.js')}}"></script>
<script src="{{asset('lib/wangEditor.min.js')}}"></script>
<script src="{{asset('js/watermelon.js')}}"></script>
</body>
</html>
